package com.songcha.sakura.mvp.view.dialog

import android.content.Context
import android.os.Bundle
import android.view.ViewGroup
import android.view.WindowManager
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.songcha.sakura.MyApplication
import com.songcha.library_common.util.ScreenUtil
import com.songcha.library_common.util.StatusBarUtil

class CustomBottomSheetDialog:BottomSheetDialog {

    constructor(context: Context) : super(context) {

    }

    constructor(context: Context, theme: Int):super(context,theme){

    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        val dialogHeight=ScreenUtil.getScreenHeight(com.songcha.sakura.MyApplication.getContext())+StatusBarUtil.getBottomBarHeight()
        window!!.setLayout(
            ViewGroup.LayoutParams.MATCH_PARENT,
            dialogHeight
        )
        window!!.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
    }

}